<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
<h:head>
<h:outputStylesheet library="css" name="default.css" target="head" />
</h:head>
<h:body>
<f:metadata>
		<f:event type="preRenderView" listener="#{userBean.istanzia()}" />
	</f:metadata>
	
	<h1>Travel Dream</h1>
	
	<p:toolbar style="heigh:35px" id="tb">
		<p:toolbarGroup align="left" style="margin-top:5px; margin-left:10px" id="tools">
		Benvenuto #{userBean.name} <p:separator/> #{userBean.mail}
		
		</p:toolbarGroup>
		<p:toolbarGroup align="right">
		<p:button value="Cerca Utente" outcome="cerca_Utente.xhtml" icon="ui-icon-suitcase" />
		<p:button value="Visualizza Pacchetti" outcome="show_pacchetti.xhtml" icon="ui-icon-suitcase" />
		<p:button value="Visualizza Carrello" outcome="show_carrello.xhtml" icon="ui-icon-cart"/>
		<p:button value="Mostra Prenotazioni" outcome="show_prenotati.xhtml" icon="ui-icon-tag"/><p:separator/>
		<p:commandButton action="#{logBean.logout}" value="Logout" icon="ui-icon-power" />
		</p:toolbarGroup>
	</p:toolbar>
	
	<div style="margin-top: 50px; margin-left=10%; margin-right=10%">
	<h:form id="form">
				
		<p:fieldset legend="Dati Personali">  
			<h:panelGrid  columns="2" columnClasses="column"
				cellpadding="5">
				<h:outputText value="Nome: " />
				<p:inplace id="ajaxInplace" >
					<p:inputText value="#{userBean.nome}"  immediate="true" required="true"
						update=":form:pers:ajaxInplace: , :toolb:tools:" />
				</p:inplace>

				<h:outputText value="Cognome: " />
				<p:inplace id="ajaxInplace2">
					<p:inputTextarea value="#{userBean.cognome}" immediate="true"
						required="true" update=":form:pers:ajaxInplace2:"/>
				</p:inplace>
				
				<h:outputText value="eMail: "/>
				<h:outputText value="#{userBean.email}"/>
				
				</h:panelGrid>
				<p:commandButton style="align:right" value="aggiorna dati" action="#{userBean.update()}" update="form"/>
		</p:fieldset>
	</h:form>
	</div>
</h:body>
</html>